
# -------------------------------------------------------------------
#
# 1. Open Command Prompt and run visual studio script to setup environment variables 
# 2. Go to project directory (i.e. this one) 
# 3. run: nmake tscanadd.dll
# 4. copy tscanadd.dll to the terrascan ma directory
#  
# Here are some examples of the script locations assuming standard VS installations
#
# Visual studio 2017 Community 
# C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64
#
# Visual studio 2015 Community 
# and Visual studio 2013 Professional 
# C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall amd64
# 
#
# -------------------------------------------------------------------



# -------------------------------------------------------------------
#	Dynamic link module C compiler / linker settings
# -------------------------------------------------------------------

CCOMP=cl -c -W3 -DwinNT -D_M_X64 -DWIN32 -DWIN32_LEAN_AND_MEAN -D_DLL -D_MT -D_AMD64_=1 -Ot 

!IF "$(VISUALSTUDIOVERSION)"=="12.0"
CLINK=link -dll -out:tscanadd.dll  /nodefaultlib addon.obj addon.res \
      msvcrt.lib gdi32.lib user32.lib kernel32.lib 
!ELSE
#Assumes that anything  not equal to 12.0 is post Visual Studio 2015
CLINK=link -dll -out:tscanadd.dll  /nodefaultlib addon.obj addon.res \
      msvcrt.lib vcruntime.lib ucrt.lib gdi32.lib user32.lib kernel32.lib 

!ENDIF

PROCESSOR=X64

# -------------------------------------------------------------------
#	Dynamic link module
# -------------------------------------------------------------------

addon.obj : addon.c
	$(CCOMP) addon.c

addon.res : addon.rc
	rc -r  addon.rc

tscanadd.dll : addon.obj addon.res
	$(CLINK)
